<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
function Person(){

}
Person.prototype.name = "李四"
Person.prototype.eat = function (){
    
}
var p1 = new Person();
var p2 = new Person();
p1.name = "张三"
console.log(p1.name);
console.log(p2.name);
console.log(p1.constructor)
console.log(p1 instanceof Person);
// [[proto]]
//console.log(p1.__proto__ === Person.prototype)
//console.log(Person.prototype.constructor === Person)
</script>
</body>
</html>
<!--
1. 在原型中定义的属性和方法对所有的对象都是共享的
2. 通过对象只能读取到原型中的数据, 但是不能直接去修改

-->